home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Virtual User 1.0 / Example Libraries / Read me First!!! next >
Text File  |  1991-01-25  |  5KB  |  123 lines

  1. This folder contains useful VU task libraries which you might want to 
  2. make use of in your scripts.
  3.  
  4. The files and brief descriptions of their contents follows:
  5.  
  6. 1. StringsLib.vu
  7.     Contains:    Task defintions to convert numbers into strings and strings into numbers.
  8.     
  9.     The main tasks are:
  10.     a)    task NumToStr(number) 
  11.     This task takes in a number and converts it into a string. If the argument 
  12.     passed in is not a number undefined is returned.
  13.  
  14.     b) task StrToNum(str, start_index := 1, end_index := -1) 
  15.     This task takes in a string and converts it into an integer, if possible.
  16.     You can pass a start and end indices into a string in which a number is 
  17.     embedded. This task deals with both positive and negative numbers.
  18.     It returns MaxNum (32767) or MinNum (-32767) in error(overflow) conditions.
  19.     It deals with cases such as "+123" and "-462" as well as unsigned ones like "981".
  20.     If the argument passed in is not a string undefined is returned.
  21.         
  22.  
  23.  
  24. 2. UtilityTasksLib.vu -
  25.     Contains: Tasks that help do some simple operations like selecting a  
  26.               file in a window or trashing it.
  27.     
  28.     a) GracefulExit( msg )
  29.     Exits VU after printing the supplied 'msg' along with script 
  30.     execution time.
  31.         
  32.     b) UseKeyboardEquivalent(alias) :
  33.     Do Menu command (selection) using key equivalent
  34.  
  35.     c) NumberOfWindows() :
  36.     Returns the total number of open windows. In system 7.0's Finder the
  37.     Desktop is considered a window. This task ignores that window and 
  38.     returns the number of regular open windows.
  39.  
  40.     d) RunningSystemSeven() :
  41.     Checks if the target running System 7.0. Returns true or false value.
  42.     
  43.     e) task OpenOneWindow() :
  44.     This task makes sure that one window is left open in the Finder.
  45.     
  46.     f) task FindObjectInWindow (at_x, at_y)
  47.     This task moves the mouse on to a particular object of interest. 
  48.     Very useful to select files in "View By Name" mode in Finder.
  49.         
  50.     g) LaunchAppInSystem6( appName := "", launch_wait := 2 )
  51.     Check for app running and/or attempt to get there by:
  52.     double-clicking the topmost file (in View by Name) in the frontmost
  53.     window in Finder. ( Intended for use under System 6.0.x ) 
  54.     launch_wait is the number of seconds to wait before checking for 
  55.     successful launch of the application.
  56.  
  57.     h) LaunchAppInSystem7( appName := "", launch_wait := 4 )
  58.     Check for app running and/or attempt to get there by:
  59.     Using Finder's Find command to select the App, then using the open 
  60.     command ( Intended for use under System 7.0 only).
  61.     launch_wait is the number of seconds to wait before checking for 
  62.     successful launch of the application.
  63.  
  64.     i) CheckForAlertWindow(override_alerts := false) :
  65.     This task handles alert dialogs with 'OK' and 'Cancel' buttons.
  66.     If override_alerts is true then select 'OK' else 'Cancel'
  67.  
  68.     j) task ThrowItemToTrash(print_any_error := true, override_alerts := false)
  69.     This task trashes a specified object in Finder. The argument 
  70.     'print_any_error' can be used to suppress the error messages 
  71.     printed by this task. 
  72.     'override_alerts' can be used to trash despite alerts (it selects 
  73.     the 'OK' button) if this argument is true (or non null).
  74.  
  75.  
  76. 3. StandardDialogsLib.vu -    
  77.     Contains:    Sample tasks for working with standard Macintosh dialogs
  78.     The tasks in this file are:
  79.     
  80.     a) DoSaveAs( save_title := 'Untitled' ) : 
  81.        This task handles a simple case of saving a file with the Standard
  82.        File dialog.
  83.     b) SelectFromStandardFile(path_to_file,maximum_nesting_depth := 64) :
  84.        This task will select a file from the standard file dialog.
  85.        It navigates through the dialog by way of the keyboard.
  86.        It takes two parameters, one is a list of file prefixes that will 
  87.        take the virtual user down to the file you want selected. The list  
  88.        must contain the strings that VU can type to reach the file.  They 
  89.        may be the complete folder names or enough of the folder name to 
  90.        distinguish them from sibling folders.  The second is a number 
  91.        indicating the current directory's maximum depth.  VU uses this 
  92.        number to get up to the top using command-up arrow.  By default, it 
  93.        is 64 so it isn't necessary to pass the second parameter.  The 
  94.        operation may be made faster, however, if you pass it a smaller 
  95.        number.  A sample call might look like this:
  96.         SelectFromStandardFile( { "HD","MPW","Interf","Cinclu",
  97.                                   "Palettes" },10 );
  98.  
  99.  
  100. 4. TimeLib.vu -
  101.     Contains:    Tasks that make it easier to work with time in VU.
  102.     
  103.   a) task WaitForTime( end_hour := 0, end_minute := 0, end_second := 0 ) :
  104.      This task will wait until a specified time of day.
  105.     
  106.   b) task PrintCurrentTime(print_date := true) :
  107.     This task pretty prints the current time.  The format is as follows:
  108.         <hour of day>:<minutes>:<seconds> <AM or PM>
  109.     It also takes one parameter that indicates whether the date should be 
  110.     printed.
  111.     If the actual parameter passed is a true value, the current date is also
  112.     printed .
  113.     If no parameter is passed, the date is printed by default.
  114.     The format of the date is as follows:
  115.         <month>/<day>/<year>    
  116.  
  117.   c) task TimeElapsed ( StartTime, StopTime ):
  118.        This task computes the difference between the start & stop time 
  119.      descriptors and returns the result in a time desciptor. The dates are
  120.      ignored. For example,
  121.      TimeElapsed([time h:2100 s:20], [time h:2220 s:40])
  122.      will result in [time h:120 s:20]
  123.